module.exports = app => {
    const { STRING, INTEGER, TEXT, DATE, BIGINT } = app.Sequelize;

    const Circle = app.model.define('circle', {
        circle_id: {
            type: BIGINT.UNSIGNED,
            primaryKey: true,
            autoIncrement: true,
        },
        name: { type: STRING(100), allowNull: false },
        type: { type: STRING(20), allowNull: false },
        description: { type: TEXT, allowNull: false },
        member_count: { type: INTEGER, allowNull: false, defaultValue: 0 },
        post_count: { type: INTEGER, allowNull: false, defaultValue: 0 },
        created_at: DATE,
        updated_at: DATE,
    }, {
        tableName: 'circles',
        timestamps: false,
    });

    return Circle;
};